<template>
  <view class="services">
    <!-- <view class="top">
			<uv-navbar title="服务介绍" height="44px" titleStyle="{font-weight: bold;font-size: 1.1rem;}"
				@leftClick="leftClick"></uv-navbar>
		</view> -->
    <!-- 服务 -->
    <view class="photo">
      <view class="one">
        <uv-swiper height="400px" :list="list"></uv-swiper>
        <view class="icon">
          <uv-icon @click="goback" name="arrow-left" size="24px"></uv-icon>
        </view>
      </view>
      <view class="two">
        <view class="two-left">已实名</view>
        <view class="two-right">
          <image src="../../static/image/位置.png" mode=""></image> {{list1.range}}
        </view>
      </view>
      <view class="three">
        <view class="two-left">师傅名称</view>
        <view class="two-right"> 已服务:{{list1.num}}|从业经历:{{list1.age}} </view>
      </view>
      <view class="four">
        <view>个人介绍:{{list1.textarea}}</view>
      </view>
    </view>
    <!-- 服务介绍 -->
    <view class="introduced">
      <view class="all">
        <view class="head" v-for="(item,index) in list2" :key="item.id">
          <view class="head-left">{{item.serve_name}}</view>
          <view class="head-right">￥{{item.price}}</view>
        </view>
        <view class="center">
          <uv-button type="primary" color="#008c8c" shape="circle" text="立即预约"></uv-button>
        </view>


      </view>
    </view>
    <!-- 师傅评价 -->
    <view class="evaluation">
      <view class="top">
        <view class="top-left">师傅评价</view>
        <view class="top-right" @click="goevaluation">查看全部<uv-icon name="arrow-right" size="20px"></uv-icon></view>
      </view>
      <view class="bottom" v-for="(item,index) in list3" @click="goevaluation">
        <view class="bottom-left">
          <uv-avatar src="/static/image/陈喜喜.jpg"></uv-avatar>
        </view>
        <view class="bottom-right">
          <view class="one">{{item.members_name}}</view>
          <view class="two">
            <uv-rate size="16px" :count="count" v-model="value1"></uv-rate>
            <view style="margin-left: 20rpx; color: #c1c1c1;">{{item.create_time}}</view>
          </view>
          <view class="three">{{item.text}}</view>
          <view class="four">
            <image src="/static/image/宠物医生.png" mode=""></image>
            <image src="/static/image/宠物医生.png" mode=""></image>
          </view>
        </view>
      </view>
    </view>
    <view class="box"></view>
    <!-- 下单 -->
    <view class="place">
      <uv-button type="primary" color="#008c8c" shape="circle" text="收藏师傅" @click="go"></uv-button>

    </view>
  </view>
</template>

<script>
  import {
    uniRequest
  } from "../../utils/request.js"
  export default {
    data() {
      return {
        count: 5,
        value1: 4,
        id: this.$route.query.id,
        list: [
          '/static/image/宠物医生.png',
          '/static/image/宠物医生.png',
          '/static/image/宠物医生.png',
        ],
        tips: '',
        value: '内容',
        list1: '',
        list2: '',
        list3: ''
      }
    },
    created() {
      const id = this.$route.query.id
      console.log('123', id)
      const that = this
      uniRequest('master/index?server=1', function(err, data) {
        if (err) {
          // 错误
          console.log(err)
        } else {
          console.log('"成功了"', data)
          that.list1 = data.list[0]
          console.log('"1"', that.list1)
          that.list2 = data.list[1]
          console.log('"2"', that.list2)
          that.list3 = data.list[2].data
          console.log('"3"', that.list3)
        }
      }, 'POST', {
        id: id
      });
    },
    methods: {
      // 跳全部评价
      goevaluation() {
        const id = this.$route.query.id
        uni.navigateTo({
          url: `/pages/evaluation/evaluation?id=${JSON.stringify(id)}`
        })
      },

      goback() {
        uni.navigateBack({
          delta: 1
        });
      },
      go(){
        const id = this.$route.query.id
        console.log('123',id)
        uni.navigateTo({
          url: `/pages/lijipingj/lijipingj?id=${JSON.stringify(id)}`
        })
      }
    }
  }
</script>

<style lang="scss">
  @import url('masterdetails.scss');
</style>